<div class="refentry" lang="en" xml:lang="en"><a id="gluSphere"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>gluSphere — draw a sphere</p></div><div class="refsynopsisdiv"><h2>C Specification</h2><div class="funcsynopsis"><table><tr><td><code class="funcdef">void <b class="fsfunc">gluSphere</b>(</code></td><td>GLUquadric*  </td><td><var class="pdparam">quad</var>, </td></tr><tr><td> </td><td>GLdouble  </td><td><var class="pdparam">radius</var>, </td></tr><tr><td> </td><td>GLint  </td><td><var class="pdparam">slices</var>, </td></tr><tr><td> </td><td>GLint  </td><td><var class="pdparam">stacks</var><code>)</code>;</td></tr></table></div></div><div class="refsect1" lang="en" xml:lang="en"><a id="parameters"></a><h2>Parameters</h2><div class="variablelist"><dl><dt><span class="term"><em class="parameter"><code>quad</code></em></span></dt><dd><p>
                    Specifies the quadrics object (created with <a class="citerefentry" href="gluNewQuadric"><span class="citerefentry"><span class="refentrytitle">gluNewQuadric</span></span></a>).
                </p></dd><dt><span class="term"><em class="parameter"><code>radius</code></em></span></dt><dd><p>
                    Specifies the radius of the sphere.
                </p></dd><dt><span class="term"><em class="parameter"><code>slices</code></em></span></dt><dd><p>
                    Specifies the number of subdivisions around the <span class="emphasis"><em>z</em></span> axis
                    (similar to lines of longitude).
                </p></dd><dt><span class="term"><em class="parameter"><code>stacks</code></em></span></dt><dd><p>
                    Specifies the number of subdivisions along the <span class="emphasis"><em>z</em></span> axis
                    (similar to lines of
                    latitude).
                </p></dd></dl></div></div><div class="refsect1" lang="en" xml:lang="en"><a id="description"></a><h2>Description</h2><p>
            <code class="function">gluSphere</code> draws a sphere of the given radius centered around the origin. The
            sphere is subdivided around the <span class="emphasis"><em>z</em></span> axis into slices and along the
            <span class="emphasis"><em>z</em></span> axis
            into stacks (similar to lines of longitude and latitude).
        </p><p>
            If the orientation is set to <code class="constant">GLU_OUTSIDE</code>
            (with <a class="citerefentry" href="gluQuadricOrientation"><span class="citerefentry"><span class="refentrytitle">gluQuadricOrientation</span></span></a>), then any normals generated
            point away from the center of the sphere.
            Otherwise, they point toward the center of the sphere.
        </p><p>
            If texturing is turned on (with <a class="citerefentry" href="gluQuadricTexture"><span class="citerefentry"><span class="refentrytitle">gluQuadricTexture</span></span></a>), then texture
            coordinates are
            generated so that <span class="emphasis"><em>t</em></span> ranges from 0.0 at
            <math overflow="scroll">

                <mrow>
                    <mi mathvariant="italic">z</mi>
                    <mo>=</mo>
                    <mrow>
                        <mo>-</mo>
                        <mi mathvariant="italic">radius</mi>
                    </mrow>
                </mrow>
            </math>
            to 1.0 at
            <math overflow="scroll">

                <mrow>
                    <mi mathvariant="italic">z</mi>
                    <mo>=</mo>
                    <mi mathvariant="italic">radius</mi>
                </mrow>
            </math>
            (<span class="emphasis"><em>t</em></span> increases linearly along longitudinal
            lines),
            and <span class="emphasis"><em>s</em></span> ranges from 0.0 at the +<span class="emphasis"><em>y</em></span> axis, to 0.25 at the
            +<span class="emphasis"><em>x</em></span> axis,
            to 0.5 at the \-<span class="emphasis"><em>y</em></span> axis, to 0.75 at the \-<span class="emphasis"><em>x</em></span> axis, and back to 1.0
            at the +<span class="emphasis"><em>y</em></span> axis.
        </p></div>
        {$pipelinestall}{$examples}
        <div class="refsect1" lang="en" xml:lang="en"><a id="seealso"></a><h2>See Also</h2><p>
            <a class="citerefentry" href="gluCylinder"><span class="citerefentry"><span class="refentrytitle">gluCylinder</span></span></a>,
            <a class="citerefentry" href="gluDisk"><span class="citerefentry"><span class="refentrytitle">gluDisk</span></span></a>,
            <a class="citerefentry" href="gluNewQuadric"><span class="citerefentry"><span class="refentrytitle">gluNewQuadric</span></span></a>,
            <a class="citerefentry" href="gluPartialDisk"><span class="citerefentry"><span class="refentrytitle">gluPartialDisk</span></span></a>,
            <a class="citerefentry" href="gluQuadricOrientation"><span class="citerefentry"><span class="refentrytitle">gluQuadricOrientation</span></span></a>,
            <a class="citerefentry" href="gluQuadricTexture"><span class="citerefentry"><span class="refentrytitle">gluQuadricTexture</span></span></a>
        </p></div><div class="refsect1" lang="en" xml:lang="en"><div id="Copyright"><h2>Copyright</h2><p>
            Copyright © 1991-2006
            Silicon Graphics, Inc. This document is licensed under the SGI
            Free Software B License. For details, see
            <a class="ulink" href="http://oss.sgi.com/projects/FreeB/" target="_top">http://oss.sgi.com/projects/FreeB/</a>.
        </p></div></div></div>
